package com.tool.emulator.apple2;

/**
 * Apple2.java @author tl 2011-6-18
 */
public interface Apple2Constants {
	public static final int SCREEN_WIDTH = 280;
	public static final int SCREEN_MIXMODE_HEIGHT = 160;
	public static final int SCREEN_HEIGHT = 192;
	public static final int TEXT_COLS = 40;
	public static final int TEXT_MIXED_ROW = 20;
	public static final int TEXT_ROWS = 24;
	public static final int ADDR_TEXT1 = 0x400;
	public static final int ADDR_TEXT2 = 0x800;
	public static final int TEXT_AREA_SIZE = 0x400;
	public static final int ADDR_HGR1 = 0x2000;
	public static final int ADDR_HGR2 = 0x4000;
	public static final int HGR_AREA_SIZE = 0x2000;

	//MONITOR
	public static final int ADDR_IO_MONITOR = 0xC050;
	public static final int ADDR_GRAPHIC_SWITCH = 0xC050;
	public static final int ADDR_TEXT_SWITCH = 0xC051;
	public static final int ADDR_FULL_SCREEN = 0xC052;
	public static final int ADDR_MIXED_SCREEN = 0xC053;
	public static final int ADDR_PAGE1 = 0xC054;
	public static final int ADDR_PAGE2 = 0xC055;
	public static final int ADDR_LOW_GRAPHICS = 0xC056;
	public static final int ADDR_HIGH_GRAPHICS = 0xC057;

	//KEYBORD
	int ADDR_KEY_IN = 0xC000;
	public static final int ADDR_KEY_RESET = 0xC010;

	//SOUND
	public static final int ADDR_RECORDER_OUT = 0xC020;
	public static final int ADDR_SPEAKER = 0xC030;
	public static final int ADDR_RECORDER_IN = 0xC060;
	public static final int RAM_OFFSET = 0;
	public static final int RAM_SIZE = 0xC000;
	public static final int IO_OFFSET = 0xC000;
	public static final int IO_SIZE = 0x800;
	public static final int IO_ROM_OFFSET = 0xC800;
	public static final int IO_ROM_SIZE = 0x800;
	public static final int ROM_OFFSET = 0xD000;
	public static final int ROM_SIZE = 0x3000;

	//APPLE2E
	int ADDR_ALTCHAR_OFF = 0xC00E;//W,Off:display text using primary character set
	int ADDR_ALTCHAR_ON = 0xC00F;//W,On
	int ADDR_RDALTCHAR = 0xC01E;//R7

	int ADDR_80COL_OFF = 0xC00C;//W;off,40 cols
	int ADDR_80COL_ON = 0xC00E;//W; On ,80 cols
	int ADDR_80COL_RD = 0xC01F;//R; query status

	int ADDR_80STORE_OFF = 0xC000;
	int ADDR_80STORE_ON = 0xC001;
	int ADDR_RD80STORE = 0xC018;//R7

	int ADDR_RDPAGE2 = 0xC01C;//R7
	int ADDR_RDTEXT = 0xC01A;//R7
	int ADDR_RDMIXED = 0xC01B;//R7
	int ADDR_RDHIRES = 0xC01D;//R7

	int ADDR_PAD0 = 0xC058;
	int ADDR_PAD1 = 0xC05A;
	int ADDR_PAD2 = 0xC05C;
	int ADDR_PAD3 = 0xC05E;

	int ADDR_STROBE_OUTPUT = 0xC040;
	/*
	 * C058-C05F Annunciator switchs
     * C040 Strobe Output
     * C061-C063 switch input,>=128 switch on
     * C070-C073 Analog Inputs Reset
     * C064-C067 Analog Inputs input
     * 
     * 
     * Memory Switches
     * Slot ROM at C300 C000B W
     * Internal ROM at C300 C000A Write
     * Read Switch C017
     * 
     * Slot ROM at Cx00 C006 write
     * Internal ROM at Cx00 C007
     * Read SLOTCXROM switch c015 
     * 
     * RDBNK2 R7 C011 Read whether D000 bank 2(1) or bak 1(0)
     * RDLCRAM R7 C012 reading RAM(1) or ROM(0)
     * ALTZP W C008 Off:use main bak
     * ALTZP W C009 W On use auxiliary bank
     * RDALTZP R7 C016
     * 
     * RAMRD read auxiliary memory C003 W
     *       read main memory      C002 W
     *       read RAMRD switch     C013 R
     * RAMWRT write aux memory     C005 W
     *        write main memory    C004 W
     *        read RAMWRT switch   C014 READ
     * 80STORE ON:access display page C001 W
     *        OFF:use RAMRD,RAMWRT C000 W
     *        Read 80STROE switch C018 R
     * PAGE2 Page2 on(aux memory) C055 
     *       Page2 off main memory C054
     *       Read PAGE2 switch C01C
     *       
     * HIRES ON c057; off c056 , read c01d
     * 
     */
}
